package com.glory.dmegcpda.model

import com.glory.dmegcpda.base.Constant
import com.glory.dmegcpda.bean.ScrinBingBoxBean
import com.glory.dmegcpda.bean.ScrinBingEqpBean
import com.google.gson.JsonObject
import rxhttp.wrapper.param.RxHttp
import rxhttp.wrapper.param.toResponse


class WeldingRepository : BaseRepository(){

    /**
     * 获取设备信息
     * */
    suspend fun scribingEqp(bodyMap: JsonObject): ScrinBingEqpBean {
        return RxHttp.postForm(Constant.mainUrl)
            .addAll(getInJsonData(bodyMap,"SYS.GETENTITYLIST"))
            .toResponse<ScrinBingEqpBean>()
            .await()
    }

    /**
     * 获取盒子信息
     * */
    suspend fun scribingBox(bodyMap: JsonObject): ScrinBingBoxBean {
        return RxHttp.postForm(Constant.mainUrl)
            .addAll(getInJsonData(bodyMap,"SYS.GETENTITYLIST"))
            .toResponse<ScrinBingBoxBean>()
            .await()
    }

    /**
     * 串焊上料
     * */
    suspend fun welbing(bodyMap: JsonObject): Any {
        return RxHttp.postForm(Constant.mainUrl)
            .addAll(getInJsonData(bodyMap,"DMEGC.PDAMLOTKITTING"))
            .toResponse<Any>()
            .await()
    }

}